/*************************************************************
 * Title: 
 * Description: 
 * Author: Snow Huang
 * Email: Shaobin.Software@gmail.com Shaobin_Software@163.com
 * CreateTime: 2010-8-1 下午03:27:02
 * Copyright © 落羽社区 All right reserved
 ************************************************************/
package snow.core.domain.query;

import java.io.Serializable;

/**
 * 
 */
public class Order implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7597889215123154256L;
	
	private boolean ascending;
	private String propertyName;

	Order(String propertyName, boolean ascending) {
		this.propertyName = propertyName;
		this.ascending = ascending;
	}

	/**
	 * @return the propertyName
	 */
	public String getPropertyName() {
		return propertyName;
	}

	/**
	 * @return the ascending
	 */
	public boolean isAscending() {
		return ascending;
	}

	public String toString() {
		return propertyName + ' ' + (ascending ? "asc" : "desc");
	}
}
